define(function(require) {

  var app = angular.module('myApp', ['ui.router']);

  app.controller('firstController', function($scope, $http) {
    $scope.person = {
      name: 'firstName'
    };

    $scope.fetchData = function() {
      $http({
        method: 'GET',
        url: 'js/data.json?' + new Date().getTime()
      }).then(function(resp) {
        // data contains the response  
        // status is the HTTP status  
        // headers is the header getter function  
        // config is the object that was used to create the HTTP request
        $scope.resp = resp;
        $scope.data = resp.data;
      });
    };
  });


  app.config(function($stateProvider, $urlRouterProvider) {
    $stateProvider.state('login', {
      url : "/login",
      templateUrl: 'login.html',
      controller: "firstController"
    });
    $stateProvider.state('register', {
      url : "/register",
      templateUrl: 'register.html',
      controller: "firstController"
    });
    // $urlRouterProvider.otherwise('login');
  });

  



  angular.bootstrap(document.body, ['myApp']);

});